﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using Deixei.Domain;
using Deixei.Infrastructure;
using Deixei.Web.Controllers;

namespace Deixei.WebApplication.Controllers
{
    [Authorize]
    public class IngredientsController : DeixeiApiController
    {

        IRepository<Ingredient> ingredientRepository;

        public IngredientsController(IRepository<Ingredient> ingredientRepository)
        {
            this.ingredientRepository = ingredientRepository;
        }

        // GET api/<controller>
        [AllowAnonymous]
        public IEnumerable<Ingredient> Get()
        {
            return ingredientRepository.All().AsEnumerable();
        }

        // GET api/<controller>/5

        public string Get(int id)
        {
            return "value";
        }

        // POST api/<controller>
        public void Post([FromBody]string value)
        {
        }

        // PUT api/<controller>/5
        public void Put(int id, [FromBody]string value)
        {
        }

        // DELETE api/<controller>/5
        public void Delete(int id)
        {
        }

    }
}